package com.lry.rpc.config;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class RpcReferenceBean {
    private String version;
    private String group;
    private String merger;
    private String token;
    private String url;
    private int retries;
    private long timeout;
    private String[] filter;
    private String serializer;
    private String compressor;
    private Class<?> interfaceClass;
    private String serviceImplName;

    public static RpcReferenceBean buildRpcReferenceBean(Class interfaceClass){
        return RpcReferenceBean.builder().version("").group("").retries(3).timeout(3000).
                interfaceClass(interfaceClass).serviceImplName("").serializer("kryo").compressor("gzip").build();
    }
}
